home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / misc_pto / asmdrv / doc2 < prev    next >
Text File  |  1988-03-13  |  10KB  |  236 lines

  1. name             size   date     time   chap page   notes
  2.  
  3. DOC2             5632   3-13-88   8:02p             This file. See (1)
  4. SIMPLE   ASM     5888   2-21-88   3:52p    3   87   Revised. See (2)
  5. TONE     ASM      768  11-02-86   2:16a    4  112
  6. CONSOLE  ASM    14592  11-02-86   2:17a    4  121
  7. IOCTL    ASM     5120  11-09-86  11:14a    5  139
  8. IOCTL    COM      743  11-08-86  10:31p    5  139   .com file for above
  9. PRINTER  ASM    17536  11-15-86  12:15a    5  166
  10. CLK      ASM    25472   3-08-88   4:14p    6  217   Revised. See (3)
  11. RAMDISK  ASM    18048  11-29-86   1:40p    8  306
  12. STRUC24  ASM     9856  12-25-86  11:47p    9  331   See (4)
  13. PROTO    ASM    19328   3-07-88   2:50p   10  386   Revised. See (5)
  14. SHOWSEG  ASM      512   1-01-86   3:58p   10  400
  15. HEX2ASC  ASM      896  10-12-86   3:05p   10  401
  16. DUMP     ASM     5760   1-01-86   5:25p   10  402
  17. PRTMSG   ASM      640   9-21-86   9:18p   10  406   See (6)
  18. NEWSTACK ASM      896  12-31-86  11:45a   10  408
  19. INT29H   ASM      640  12-31-86  11:35a   10  409
  20. SETCMD   ASM     1024  12-30-86   7:06p   10  411   See (7)
  21. STRAT    ASM     1280  10-13-87   9:41p   10  412   See (7)
  22. SETATT   ASM     1408  12-30-86   7:05p   10  413
  23.  
  24. notes
  25.  
  26. 1. Due to the changes that are made at the last minute, some comments
  27. in the book do not appear in these sources. They are, however, cosme-
  28. tic items such as author, date, and purpose: the code is the same.
  29.  
  30. 2. Changes to the Simple Device Driver
  31.  
  32. Page 87:
  33.  
  34. The attribute word in the Device Header is incorrect and should be:
  35.  
  36.         attribute       dw      8000h           ;character device
  37.  
  38. Pages 85,89:
  39.  
  40. For many versions of DOS, the Simple Device Driver as listed in the
  41. book booted correctly. However, for other versions of MS-DOS, the
  42. Simple Device Driver hung the system during the boot. In order to
  43. ensure that the Simple Device Driver work with all versions of DOS,
  44. the Break Address code needs to be added. The following code is added
  45. right after the label 'exit2' (shown):
  46.  
  47.         exit2:                          ; Set done flag and no error
  48.                 lea     ax,exit         ;address of end of simple
  49.                 mov     es:[bx]+0eh,ax  ;tell DOS next free location
  50.                 push    cs              ;same for segment address
  51.                 pop     ax              ; now in ax
  52.                 mov     es:[bx]+10h,ax  ;return to DOS
  53.                 mov     es:word ptr 3[bx],0100h
  54.  
  55. Page 86,89:
  56.  
  57. The label 'exit' is placed just before the End of Program Section and
  58. is after the last code address of the Simple Device Driver. This Break
  59. Address tells DOS that memory locations following  'exit' are not part
  60. of the Simple Device Driver and are eligible for use by DOS. The code
  61. should look like:
  62.  
  63.         exit:
  64.         ;***********************************************************
  65.         ;*      END OF PROGRAM                                     *
  66.         ;***********************************************************
  67.  
  68.  
  69. 3. Changes to the Clock Device Driver:
  70.  
  71. Although the book indicates to name the file 'clock.asm', some ver-
  72. sions of MS-DOS do not allow the use of 'clock'. For example, the MS-
  73. DOS version 2.11 supplied with the Toshiba 1100 has a built-in clock
  74. and no disk files may be named 'clock'. This is a gross error. For PC-
  75. DOS you may rename this file to 'clock.asm'.
  76.  
  77. Pages 190, 217:
  78.  
  79. The timer segment should look like:
  80.  
  81. timer           segment at      0h      ;int 1c segment
  82.                 org     1ch*4
  83. timer_int       label   dword           ;* revised to double word
  84. timer           ends
  85.  
  86. Pages 194,220:
  87.  
  88. The screen attribute for the time string variable 'time' was omitted.
  89. The value '0b' yields a blue character:
  90.  
  91. time           dw        8 dup (0b3ah)  ;time display
  92.  
  93. Pages 199,223:
  94.  
  95. The 'clkint' procedure should be moving 16 bytes of the time string.
  96. Change the 10 to 16 in the second instruction before the label 'hlow':
  97.  
  98.  
  99.         mov     cx,16           ;move 16 bytes
  100.         cli                     ;clear interrupts
  101. hlow:                           ;wait for horizontal scan
  102.  
  103. Pages 205,226:
  104.  
  105. Just before the label 'curr_days' in the code for the Input command, a
  106. check for the current year being a leap year was missing. The
  107. following code:
  108.  
  109. ;BX has total days and cl has leap year indicator
  110.         mov     ah,0                    ;set up for add
  111.         add     bx,ax                   ;add leap days to total
  112.  
  113. should be changed to:
  114.  
  115. ;BX has total days and cl has leap year indicator
  116.         mov     ah,0                    ;set up for add
  117.         push    cx                      ;* save for later use
  118.         cmp     cl,0                    ;* check for year is leap year
  119.         je      leapadj                 ;* maybe not past leap
  120.         inc     ax                      ;* past leap year => add 1
  121. leapadj:
  122.         add     bx,ax                   ;add leap days to total
  123.  
  124. The code for converting months to elapsed days is incorrectly adding
  125. an extra months worth of days. The following code just before the
  126. label 'cvt2days':
  127.  
  128.         push    cx                      ;save for leap year check
  129.         mov     bh,0                    ;clear hi-order
  130. cvt2days:
  131.  
  132. should be changed to:
  133.  
  134.         push    cx                      ;save for leap year check
  135.         dec     cx                      ;* elapsed up to current month
  136.         mov     bh,0                    ;clear hi-order
  137. cvt2days:
  138.  
  139. Pages 206,227:
  140.  
  141. The code at the end of the Input command processing did not account
  142. for a leap year when adjusting past 2/29. In addition, the days in the
  143. current month was not read from the clock chip. The following code:
  144.  
  145.         add     ax,bx                   ;add to days in current year
  146.         cmp     cl,3                    ;past March?
  147.         jl      leapyr                  ;no
  148.         inc     ax                      ;yes - add 1 for 2/29
  149. leapyr: pop     bx                      ;restore DOS date offset
  150.         pop     es                      ;restore DOS date segment
  151.         mov     es:[bx].dos_day,ax      ;return days since 1/1/80
  152.         mov     ax,0                    ;status ok
  153.         mov     bx,6                    ;count of 6
  154.         jmp     load_status             ;restore es:bx exit
  155.  
  156. should be modified to look like:
  157.  
  158.         add     ax,bx                   ;add to days in current year
  159.         pop     bx                      ;* leap indicator?
  160.         cmp     bl,0                    ;* is current year leap?
  161.         jne     leapyr                  ;* no
  162.         cmp     cl,3                    ;past March?
  163.         jl      leapyr                  ;no
  164.         inc     ax                      ;yes - add 1 for 2/29
  165. leapyr:
  166.         xchg    ax,cx                   ;* save days in cx
  167.         dec     dx                      ;* base+6 is
  168.         in      al,dx                   ;* days in current month
  169.         call    bcd2hex                 ;* convert to hex
  170.         mov     ah,0                    ;* clear hi for next add
  171.         add     cx,ax                   ;* add days in this month
  172.         dec     cx                      ;* subtract 1 for elapsed days
  173.         xchg    ax,cx                   ;* total days in ax
  174.         pop     bx                      ;restore DOS date offset
  175.         pop     es                      ;restore DOS date segment
  176.         mov     es:[bx].dos_day,ax      ;return days since 1/1/80
  177.         mov     ax,0                    ;status ok
  178.         mov     bx,6                    ;count of 6
  179.         jmp     load_status             ;restore es:bx exit
  180.  
  181. Pages 208,228:
  182.  
  183. In the conversion from DOS date format to chip date format, the days
  184. since 1/1/80 was not incremented by 1 for elapsed days. The code
  185. between the labels 'out_years' and 'out1' should look like:
  186.  
  187. out_years:
  188.         mov     ax,cs:dosdays           ;get days since 1/1/80
  189.         cmp     ax,0                    ;date not set?
  190.         je      out8                    ;skip everything
  191.         inc     ax                      ;* add 1 for elapsed days
  192.         mov     bx,0                    ;BX = year count
  193. out1:   cmp     ax,365                  ;day count within a year?
  194.  
  195.  
  196. Pages 215,232:
  197.  
  198. The code to switch the timer interrupt to point to our 'clkint' rou-
  199. tine should be changed to reflect the change in the timer interrupt
  200. definition. The code just after the label 'calc' should look like:
  201.  
  202. calc:   call    display                 ;setup initial time
  203.         cli                             ;clear interrupts
  204.         assume  es:timer                ;new directive
  205.         mov     ax,timer                ;get segment addr
  206.         mov     es,ax                   ;set ES
  207.         mov     ax,es:timer_int         ;get old timer offset
  208.         mov     cs:old1c_ofs,ax         ;save it
  209.         mov     ax,es:timer_int[2]      ;get old timer segment
  210.         mov     cs:old1c_seg,ax         ;save it
  211.         lea     ax,clkint               ;get new offset
  212.         mov     es:timer_int,ax         ;set new offset
  213.         mov     es:timer_int[2],cs      ;also segment
  214.         assume  es:cseg                 ;restore directive
  215.         sti                             ;restore interrupts
  216.  
  217. 4. 'STRUC24.ASM' contains the definitions for all of the strucs. You
  218. may include this file in any device driver, it may be more efficient
  219. to break out each struc into separate files and to include them only
  220. as needed.
  221.  
  222. 5. Changes to the prototype program 'Proto.asm' are identical to those
  223. made for the Clock Device Driver.
  224.  
  225. 6. 'PRTMSG.ASM' can be used in any program and uses the printer BIOS
  226. routine.
  227.  
  228. 7. 'SETCMD.ASM' is named 'dosver' in the source. If this code is used
  229. in the Initialization Command code, then the STRATEGY procedure must
  230. be replaced by the version in 'STRAT.ASM'. The bold-face type for the
  231. changed statements in 'STRAT.ASM' didn't make it to printing. The two
  232. statements are:
  233.  
  234.         cmp     al,cs:max_cmd
  235.         ja      unknown